home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWODUtil / Include / FWODExce.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.5 KB  |  91 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWODExce.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWODEXCE_H
  11. #define FWODEXCE_H
  12.  
  13. #ifndef FWEXCLIB_H
  14. #include "FWExcLib.h"
  15. #endif
  16.  
  17. // ----- OpenDoc Includes -----
  18.  
  19. // This file included here to satisfy the kludgy OpenDoc hack
  20. // wherein AltPoint.h must be included before ODTypes.h
  21. #ifndef _ALTPOINT_
  22. #include <AltPoint.h>
  23. #endif
  24.  
  25. #ifndef _ODTYPES_
  26. #include <ODTypes.h>    
  27. #endif
  28.  
  29. #if FW_LIB_EXPORT_PRAGMAS
  30. #pragma lib_export on
  31. #endif
  32.  
  33. //========================================================================================
  34. // Forward declarations
  35. //========================================================================================
  36.  
  37. struct Environment;
  38.  
  39. //========================================================================================
  40. // Macros
  41. //========================================================================================
  42.  
  43. #ifdef SOMCHKEXCEPT
  44. #undef SOMCHKEXCEPT
  45. #endif
  46.  
  47. #define SOMCHKEXCEPT ::FW_FailODError(ev)
  48.  
  49. //========================================================================================
  50. // Global functions
  51. //========================================================================================
  52.  
  53. FW_FUNC_ATTR void FW_FailODError(Environment* ev);
  54. FW_FUNC_ATTR void FW_SetODException(Environment* ev, ODError error);
  55. FW_FUNC_ATTR ODError FW_GetODException(Environment* ev);
  56. FW_FUNC_ATTR void FW_SetException(Environment *ev, const FW_XException& exception);
  57.  
  58. //========================================================================================
  59. // CLASS FW_XOpenDocException
  60. //========================================================================================
  61.  
  62. class FW_CLASS_ATTR FW_XOpenDocException : public FW_XException
  63. {
  64. public:
  65.     FW_XOpenDocException(Environment* ev);
  66.     FW_XOpenDocException(ODError error);
  67.     virtual ~FW_XOpenDocException();
  68.     
  69.     Environment* GetEnvironment() const;
  70.     ODError GetODError() const;
  71.  
  72.     FW_DECLARE_EXCEPTION(FW_XOpenDocException)
  73. private:
  74.     Environment* fEv;
  75. };
  76.  
  77. //----------------------------------------------------------------------------------------
  78. // FW_XOpenDocException::GetEnvironment
  79. //----------------------------------------------------------------------------------------
  80.  
  81. inline Environment* FW_XOpenDocException::GetEnvironment() const
  82. {
  83.     return fEv;
  84. }
  85.  
  86. #if FW_LIB_EXPORT_PRAGMAS
  87. #pragma lib_export off
  88. #endif
  89.  
  90. #endif
  91.